package streaming;

import simulation.Config;
import simulation.DistributionEnum;

public class StreamingConfig {
	
	// Rate of packets per second
	static public int MCASTRATE = 30;
	static public int PACKETSIZE = 1000;
	// size of buffering window in seconds
	static public int MCASTWINDOWSIZE = 60; // Disponibility window
	static public int MCASTBUFFERSIZE = StreamingConfig.MCASTWINDOWSIZE*StreamingConfig.MCASTRATE; // Disponibility window array size  
	static public int MCASTINTERESTWINDOWSIZE = 60; // Interest window
	static public double RECEIVE_TIMEOUT = 30.0; // timeout (in sec.) to wait for a requested chunk. After that, the chunk status will be changed back from Pending to Notified Only

	// Multiplied by number of neighbors of non-seed. - used for fireflies topology
	
	static public double SENDERATTENDRATIO = 4.0;
	static public double NONSENDERATTENDRATIO = 1.1;
	// Carefull to change - I'm assuming one second in a lot of places.
	static public double MCASTUPDATEINTERVAL = 1.0;
	
	// Update interval of comparator module and tracker
	static public double COMPARATOR_MODULE_UPDATE_INTERVAL = 0.1;
	public static final double TRACKER_UPDATE_INTERVAL = 1.0;
	public static double TRACKER_CHUNK_SELECTION_INTERVAL = 15.0;
	public static boolean ALWAYS_POLLUTE = true; //used by attacker 5, polluter
	
	// Defines if simulation will have attackers or not 
	static public boolean SIMULATION_WITH_ATTACKERS = true;
	
	// Defines which type of attack will be selected (1 to 5)
	static public int ATTACK_TYPE = 5;
	
	// Defines the ratio of attackers
	static public double ATTACKERS_RATIO = 0.01;
	
	// Defines the number of initial simulation's host
	static public int INITIAL_HOSTS_NUMBER = 100;
	static public double SEEDNEIGHBORS = (StreamingConfig.INITIAL_HOSTS_NUMBER / 20); // 10%
//	static public double SEEDNEIGHBORS = 10;
	// Defines if simulation will execute with dynamic insertion/removal 
	static public boolean DYNAMIC_INSERTION_ON = false;
	static public boolean DYNAMIC_REMOVAL_ON = false;
	
	// defines the interval for dynamic insertion/removal
	static public double DYNAMIC_HOST_INSERTION_INTERVAL = 0.12;
	static public double DYNAMIC_HOST_REMOVAL_INTERVAL = 0.1;
	
	// Maximum number of outstanding requests with any particular neighbor
	static public int MCASTMAXOUTSTANDING = 1;
	
	// Distributions configuration
	static public boolean USE_INSERTION_DISTRIBUTION = true;
	static public boolean USE_REMOVAL_DISTRIBUTION = true;
	static public DistributionEnum INSERTION_DISTRIBUTION_TYPE = DistributionEnum.NORMAL;
	static public DistributionEnum REMOVAL_DISTRIBUTION_TYPE = DistributionEnum.POISSON;
	
	static public double POISSON_INSERTION_MEAN = (Config.TIME / 2); 
	
	static public double NORMAL_INSERTION_MEAN = (Config.TIME / 2); 
	static public double NORMAL_INSERTION_STANDARD_DEVIATION = (Config.TIME) / 10; // 10% of time value -- this is hypothetical
	
	static public double POISSON_REMOVAL_MEAN = (Config.TIME / 2); // (TIME / 2) because, in the middle of execution, we estimate that will have the most entrances
	
	static public double NORMAL_REMOVAL_MEAN = (Config.TIME / 2);
	static public double NORMAL_REMOVAL_STANDARD_DEVIATION = (Config.TIME) / 10; // 10% of time value -- this is hypothetical

	static public int HOSTS_NUMBER_TO_INSERT_ON_DISTRIBUTION = (int) (INITIAL_HOSTS_NUMBER * 1);
	static public int HOSTS_NUMBER_TO_REMOVE_ON_DISTRIBUTION = (int) (INITIAL_HOSTS_NUMBER * 1);
}
